home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2008 April
/
PCWorld_2008-04_cd.bin
/
komercni software
/
miton
/
SystemMechanic7Pro.exe
/
{app}
/
smhtml.dll
/
1033
/
HTML
/
LABEL.JS
< prev
next >
Wrap
Text File
|
2008-01-24
|
3KB
|
118 lines
function Label()
{
this.ID = "";
this.Text = "";
this.Color = "";
this.Class = "";
this.Event = "";
this.OnMouseOver = "";
this.OnMouseOut = "";
this.Show = __ShowLabel;
this.Hide = __HideLabel;
this.Render = __RenderLabel;
this.SetLabelText = __SetLabelText;
this.ChangeText = __ChangeText;
this.Visible = __LabelVisible;
this._Visible = true;
this._Rendered = false;
}
function __RenderLabel()
{
if (this._Rendered)
return "";
var content = "";
var display = "inline";
var classtext = this.Class == "" ? "" : " class=\"" + this.Class + "\" ";
var eventtext = this.Event == "" ? "" : " onclick=\"" + this.Event + "\" ";
var mouseover = this.OnMouseOver == "" ? "" : " onmouseover=\"" + this.OnMouseOver + "\" ";
var mouseout = this.OnMouseOut == "" ? "" : " onmouseout=\"" + this.OnMouseOut + "\" ";
if (!this._Visible)
{
display = "none";
content += "<span " + classtext + " " + eventtext + " id=\"label_" + this.ID + "\" style=\"display:" + display + "\" " + mouseover + mouseout + ">";
}else
{
content += "<span " + classtext + " " + eventtext + " id=\"label_" + this.ID + "\" " + mouseover + mouseout + " >";
}
//content += "<span id=\"label_" + this.ID + "\" style=\"display:" + display + "\">";
// content += "<span id=\"label_" + this.ID + "\" ";
// if (!this._Visible) content += "style=\"display:" + display + "\" ";
// contetn += ">";
if(this.Color != "")
content += "<font color="+this.Color+">";
content += this.Text;
if(this.Color != "")
content += "</font>";
content += "</span>";
this._Rendered = true;
return content;
}
function __SetLabelText(label)
{
var element = document.getElementById("label_" + this.ID);
var content = "";
if(this.Color != "")
content += "<font color="+this.Color+">";
content += label;
if(this.Color != "")
content += "</font>";
element.innerHTML = content;
}
function __HideLabel()
{
var element = document.getElementById("label_" + this.ID);
element.style.display = "none";
}
function __ShowLabel()
{
var element = document.getElementById("label_" + this.ID);
element.style.display = "block";
}
function __ChangeText()
{
this.SetLabelText(this.Text);
}
function __LabelVisible()
{
var element = document.getElementById("label_" + this.ID);
var panelDisplay = element.style.display;
return panelDisplay == "none" ? false : true;
}